package cn.tedu.weibo.mapper;

import cn.tedu.weibo.entity.Weibo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {

    @Insert("insert into weibo values(null,#{content},#{created},#{userId},#{nick})")
    void insert(Weibo weibo);

    @Select("select * from weibo")
    @Result(column = "user_id",property = "userId")
    List<Weibo> select();

    @Delete("delete from weibo where id=#{id}")
    void delete(int id);
}
